home *** CD-ROM | disk | FTP | other *** search
- Path: news.rain.org!usenet
- From: "Guus Leeuw jr." <guusl@eiffel.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Linking WASM to WPP code
- Date: Sun, 25 Feb 1996 10:59:08 -0800
- Organization: Interactive Software Engineering Inc. http://www.eiffel.com/
- Message-ID: <3130B17C.219A02F9@eiffel.com>
- References: <4gg5m3$4f0@news1.usa.pipeline.com> <1996Feb23.142043.5037@pat.uwe.ac.uk>
- NNTP-Posting-Host: @outback.eiffel.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; Linux 1.2.8 i586)
-
- P Ross wrote:
- >
- > I have some code which is written in C which I'm trying to get working with
- > the watcom c plus plus compiler. It calls an external assembler procedure
- > which even though compiles ok won't link into my code. I keep getting an
- > undefined refernce.
- >
- > How should I prototype the function in the C++ code to get it to work ?
- >
- > The assembler proc is _VR_ResetTimer, and in my code I have void
- > VR_ResetTimer(void).
-
- Two things:
- a) your ASM proc must be compiled with C calling conventions;
- b) your prototype must be `extern "C"'. The C++ compiler will then apply C name mangling
- instead of C++ name mangling.
-
- If it still doesn't work this way, you might try to remove the leading underscore in
- your ASM source. I don't know what your assembler does, but I do know that MASM 6.0
- (Microsoft Macro Assembler) puts a leading underscore on any proc with C calling
- conventions.
-
- Hope this helps,
- Guus
-